<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::table(config('permission.table_names.roles'), function (Blueprint $table) {
            $table->tinyInteger('built_in')->default(0)->after('status')->comment('系统内置角色: 0 - 否, 1 - 是');
            $table->integer('sort')->default(0)->after('status')->comment('角色排序');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table(config('permission.table_names.roles'), function (Blueprint $table) {
            $table->dropColumn('built_in');
            $table->dropColumn('sort');
        });
    }
};
